home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 1.iso / dist / fw_enlightenment.idb / usr / freeware / bin / e_cache_query.z / e_cache_query
Text File  |  2001-10-09  |  3KB  |  63 lines

  1. #!/bin/sh
  2. ##############################################################################
  3. # queries sizes of your enlightenment cache                                  #
  4. #
  5. # Copyright (C) 1999 Carsten Haitzler, Geoff Harrison and various contributors
  6. # Permission is hereby granted, free of charge, to any person obtaining a copy
  7. # of this software and associated documentation files (the "Software"), to
  8. # deal in the Software without restriction, including without limitation the
  9. # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  10. # sell copies of the Software, and to permit persons to whom the Software is
  11. # furnished to do so, subject to the following conditions:
  12. # The above copyright notice and this permission notice shall be included in
  13. # all copies of the Software, its documentation and marketing & publicity
  14. # materials, and acknowledgment shall be given in the documentation, materials
  15. # and software packages that this Software was used.
  16. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. # THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  20. # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  21. # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. ##############################################################################
  23.  
  24. PATH=$PATH:"/usr/local/enlightenment/bin:/usr/enlightenment/bin:/opt/enlightenment/bin:/usr/local/bin:"$EBIN
  25. export PATH
  26.  
  27. if [ $# -lt 1 ]; then
  28.   echo "usage:"
  29.   echo "    "$0" [ all | pager | bgsel | config ]"
  30.   exit
  31. fi
  32.  
  33. if [ $1 = "all" ]; then
  34.   VAL=`du -s $ECACHEDIR/cached/pager $ECACHEDIR/cached/bgsel $ECACHEDIR/cached/cfg | awk '{printf("%s ", $1);}'`
  35.   TOT=0
  36.   for I in $VAL; do
  37.     TOT=$[ $TOT + $I ];
  38.   done
  39.   eesh -e "dialog_ok Your caches are using $TOT Kb of disk space."
  40.   exit
  41. fi
  42.  
  43. if [ $1 = "pager" ]; then
  44.   VAL=`du -s $ECACHEDIR/cached/pager | awk '{printf("%s", $1);}'`
  45.   eesh -e "dialog_ok Your pager background cache is using $VAL Kb of disk space."
  46.   exit
  47. fi
  48.  
  49. if [ $1 = "config" ]; then
  50.   VAL=`du -s $ECACHEDIR/cached/cfg | awk '{printf("%s", $1);}'`
  51.   eesh -e "dialog_ok Your config file cache is using $VAL Kb of disk space."
  52.   exit
  53. fi
  54.  
  55. if [ $1 = "bgsel" ]; then
  56.   VAL=`du -s $ECACHEDIR/cached/bgsel | awk '{printf("%s", $1);}'`
  57.   eesh -e "dialog_ok Your background selector cache is using $VAL Kb of disk space."
  58.   exit
  59. fi
  60.